﻿using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using MyFloridaHouse.DataAccess.Extensions;
using MyFloridaHouse.libSvDTO;

//TODO: Secure all function here so an exception doesn't kill the program
namespace MyFloridaHouse.DataAccess
{
	/// <summary>
	/// Data access layer storage operation methods.
	/// </summary>
    public partial class DAL_CensusData 
    {
		/// <summary>
		/// Initializes a new instance of the <see cref="DAL_CensusData"/> class.
		/// Data access layer storage operation methods.
		/// </summary>
        public DAL_CensusData()
        {
        }

        /// <summary>
        /// Establishes the database connection
        /// </summary>
        /// <returns>SqlConnection</returns>
        /// <remarks>None</remarks>
        internal static SqlConnection Connect()
        {
            ConnectionStringSettingsCollection connectionStrings = ConfigurationManager.ConnectionStrings;

            ConnectionStringSettings conStrSetting = connectionStrings["MyFloridaHouse.MapServer.Properties.Settings.Reap"];

            string conStr = conStrSetting.ToString();
            SqlConnection sqlConn = new SqlConnection(conStr);
            return sqlConn;
        }


	}
}
